import React, {PureComponent} from 'react';
import {StyleSheet, View, Image, Text} from "react-native";

const img = {
  outed: require("./img/out.png"),
  checked: require("./img/check.png")
}


class Checkbox extends PureComponent {
  static propTypes = {
    isChecked: Boolean,
    text: String
  }


  render() {
    const {
      isChecked,
      text
    } = this.props
    return (
      <View style={styles.container}>
        <Image style={styles.checkBoxImg} source={isChecked ? img.checked : img.outed}></Image><Text>{text}</Text>
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flexDirection: 'row'
  },
  checkBoxImg: {}
})


export default Checkbox;
